package com.mongo.aggregation.model.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.TypeAlias;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

/**
 * @author: qilongxin
 * @date: 2021/11/11 17:03
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@FieldNameConstants
@TypeAlias(value = "sales")
@Document(value = "sales")
public class SalesEntity {

    @Id
    private String id;

    private List<item> items;

    @Data
    static class item {
        private String name;
        private List<String> tags;
    }

}
